package com.aisile.sellergoods.service.impl;

import com.aisile.mapper.TbGoodsDescMapper;
import com.aisile.mapper.TbGoodsMapper;

import com.aisile.mapper.TbItemMapper;
import com.aisile.pojo.TbGoods;
import com.aisile.pojo.TbGoodsDesc;
import com.aisile.pojo.TbItem;
import com.aisile.pojogroup.Goods;
import com.aisile.sellergoods.service.GoodsService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    TbGoodsMapper tbGoodsMapper;
    @Autowired
    TbGoodsDescMapper tbGoodsDescMapper;
    @Autowired
    TbItemMapper tbItemMapper;
    @Override
    public void save(Goods goods) {
        TbGoods goods1 = goods.getGoods();
        goods1.setAuditStatus("0");
        tbGoodsMapper.insert(goods1);

        TbGoodsDesc goodsDesc = goods.getGoodsDesc();
        goodsDesc.setGoodsId(goods1.getId());
        tbGoodsDescMapper.insert(goodsDesc);

        List<TbItem> itemList = goods.getItemList();
    }
}
